<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>Hello!!</title>
	<style>
		body {
			margin: 0px;
		}

		iframe {
			width: 100%;
			height: 100%;
		}
	</style>
</head>

<body scroll="no">
	<iframe id="sub-frame" src="#" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>

	<script>

/*var query = window.location.search.substring(1);
console.log(query);
var pair = query.split("=");
if( pair[0]=='a' && pair[1]>0){
        
}*/

		function resize() {
			// document.getElementById('sub-frame').style.height = document.body.clientHeight + "px";
			document.getElementById('sub-frame').style.height = window.innerHeight + "px";

		}
		window.onload = resize;
		window.onresize = resize;

		function sendMsgToSubframe(msg) {
			var subFrame = document.getElementById("sub-frame");
			subFrame.contentWindow.postMessage(msg, "*");
		}

		function GetQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if (r != null) return unescape(r[2]); return null;
		}

		var href = location.href;
		var num = href.indexOf("?")

		var queryStr = "";

		var subFrame = document.getElementById("sub-frame");

		//改成自己的网站地址
		//subFrame.src = "https://www.baidu.com/s";
        //subFrame.src = "http://haoyou.quweiyou.com.cn";
		var host = "http://haoyou.quweiyou.com.cn";

	var query = window.location.search.substring(1);
	var vars = query.split("&");
	var obj = {};
	for (var i=0;i<vars.length;i++) {
	    var pair = vars[i].split("=");
	    obj[pair[0]] = pair[1];
	}

    if(obj.a!=undefined){
        subFrame.src = host + "/e/aiya?i=" + obj.a + "_";                   
    } else {
        subFrame.src = host;      
    }

	</script>
</body>

</html>